package com.mt.roll.core.dal.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.time.LocalDate;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 系统用户表
 * </p>
 *
 * @author mt
 * @since 2021-12-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_sys_user")
public class SysUser extends Model<SysUser> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键，自增
     */
      @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 组织ID
     */
    @TableField("org_id")
    private Long orgId;

    /**
     * 帐号
     */
    @TableField("account")
    private String account;

    /**
     * 密码，存放加密后的密码，加密方式：md5(password+nonce_str)，转成小写存储
     */
    @TableField("password")
    private String password;

    /**
     * 工号
     */
    @TableField("code")
    private String code;

    /**
     * 姓名
     */
    @TableField("name")
    private String name;

    /**
     * 性别：1、男性，2、女性，0、未知
     */
    @TableField("sex")
    private Integer sex;

    /**
     * 系统用户手机号
     */
    @TableField("mobile")
    private String mobile;

    /**
     * 电话号码
     */
    @TableField("phone")
    private String phone;

    /**
     * 身份证
     */
    @TableField("idcard")
    private String idcard;

    /**
     * 生日
     */
    @TableField("birthday")
    private LocalDate birthday;

    /**
     * 系统用户邮箱
     */
    @TableField("email")
    private String email;

    /**
     * 头像
     */
    @TableField("portrait")
    private String portrait;

    /**
     * 微信
     */
    @TableField("wechat")
    private String wechat;

    /**
     * QQ
     */
    @TableField("qq")
    private String qq;

    /**
     * 联系地址
     */
    @TableField("address")
    private String address;

    /**
     * 密码随机串，用于加密明文密码
     */
    @TableField("nonce_str")
    private String nonceStr;

    /**
     * 修改密码时间
     */
    @TableField("modify_password_time")
    private LocalDateTime modifyPasswordTime;

    /**
     * 手机号码是否激活：0、未激活，1、激活，根据是否使用过短信验证码登录确认是否激活状态
     */
    @TableField("mobile_enabled")
    private Integer mobileEnabled;

    /**
     * 启用状态:0 、停用，1、启用
     */
    @TableField("enabled")
    private Integer enabled;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 删除标志，是否有效:1 可用 0不可用
     */
    @TableField("valid")
    @TableLogic
    private Integer valid;

    /**
     * 创建人
     */
    @TableField("creator")
    private Long creator;

    /**
     * 创建人姓名
     */
    @TableField("creator_name")
    private String creatorName;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @TableField("updater")
    private Long updater;

    /**
     * 更新人姓名
     */
    @TableField("updater_name")
    private String updaterName;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 版本号
     */
    @TableField("version")
    @Version
    private Integer version;


    public static final String ID = "id";

    public static final String ORG_ID = "org_id";

    public static final String ACCOUNT = "account";

    public static final String PASSWORD = "password";

    public static final String CODE = "code";

    public static final String NAME = "name";

    public static final String SEX = "sex";

    public static final String MOBILE = "mobile";

    public static final String PHONE = "phone";

    public static final String IDCARD = "idcard";

    public static final String BIRTHDAY = "birthday";

    public static final String EMAIL = "email";

    public static final String PORTRAIT = "portrait";

    public static final String WECHAT = "wechat";

    public static final String QQ = "qq";

    public static final String ADDRESS = "address";

    public static final String NONCE_STR = "nonce_str";

    public static final String MODIFY_PASSWORD_TIME = "modify_password_time";

    public static final String MOBILE_ENABLED = "mobile_enabled";

    public static final String ENABLED = "enabled";

    public static final String REMARK = "remark";

    public static final String VALID = "valid";

    public static final String CREATOR = "creator";

    public static final String CREATOR_NAME = "creator_name";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATER = "updater";

    public static final String UPDATER_NAME = "updater_name";

    public static final String UPDATE_TIME = "update_time";

    public static final String VERSION = "version";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
